'use strict';
exports = module.exports = function ($scope) {
    $scope.code = "abcd";
    $scope.codeArr = [{w:"a",s:1},{w:"b",s:1},{w:"c",s:1},{w:"d",s:1}];
    $scope.$watch("code",function(n,o){
        var na = n.split("");
        var caa = [];
        for( var i=0,l=na.length;i<l;i++ ){
            var one = {w:na[i],s:1};
            if( !/^[1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM\~\!\@\#\$\%\^\&\*\(\)\_\+\|\-\=\\\[\]\;\'\,\.\/\{\}\:\"\<\>\?\/\*\-\+\. ]$/.test(na[i]) )
            one.s=0
            caa.push(one)
        }
        $scope.codeArr = caa
    });
}
